package cn.com.blueInfo.bpm.system.enums;

import cn.com.blueInfo.bpm.common.enums.BaseEnum;
import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 菜单类型
 * @author suxch
 * @since 2025-08-28 22:06:38
 */
@Getter
@AllArgsConstructor
public enum MenuType implements BaseEnum<Integer> {

    /** 菜单类型-系统菜单 */
    SYSTEM_MENU(1, "系统菜单"),
    /** 菜单类型-业务菜单 */
    BUSINESS_MENU(0, "业务菜单");

    @EnumValue
    private final Integer code;

    @JsonValue
    private final String desc;

    public static MenuType getByCode(Integer code) {
        return BaseEnum.getByCode(MenuType.class, code);
    }

    @JsonCreator
    public static MenuType getByName(String name) {
        return BaseEnum.getByName(name, MenuType.class);
    }

}
